#ifndef M21c5e817a71348efa2936d0d2bc566d7
#define M21c5e817a71348efa2936d0d2bc566d7
/**
 *   Copyright (c) Rich Hickey. All rights reserved.
 *   The use and distribution terms for this software are covered by the
 *   Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
 *   which can be found in the file epl-v10.html at the root of this distribution.
 *   By using this software in any fashion, you are agreeing to be bound by
 * 	 the terms of this license.
 *   You must not remove this notice, or any other, from this software.
 **/

/**
 *   Author: Timothy Baldridge
 **/


#include "Ref.h"
#include <QObject>
#include <cstddef>
#include "ICastable.h"
#include "IPersistentMap.h"
// Abstract class that all Clojure-CXX objects inherit from.
namespace clojure_lang {
    class CjObject : public QObject, public ICastable
{
        Q_OBJECT
        Q_INTERFACES(clojure_lang::ICastable)
private:
        QWeakPointer<CjObject> _internalWeakPointer;

protected :
        Ref(IPersistentMap) _meta;
public:
	CjObject(void);
        CjObject(Ref(IPersistentMap) meta);
	virtual ~CjObject(void);
        virtual bool equals(CjObject *obj) = 0;
        virtual int getHashCode() = 0;
        virtual IPersistentMap *meta();
        virtual CjObject *withMeta(Ref(IPersistentMap) meta) = 0;

        template <class T> T *dynamicCast()
        {
            return dynamic_cast<T *>(this);
        }
        template <class T> T *staticCast()
        {
            return static_cast<T *>(this);
        }
};
}

#endif
